﻿
/*----------------------------------------------------------------//
// 文件名：MoDocsrvstatus.cs
// 文件功能描述：实体 MoDocsrvstatus.
// 
// 创建标识：2009-04-29
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoDocsrvstatus
using System;
using System.Data;
namespace DocSrv.Model
{
	/// <summary>
	/// Excel文件处理状态记录表。
    /// 
	/// </summary>
	public partial class MoExcelSrvStatus:ICloneable
	{
		#region 表Docsrvstatus的字段
		private string fileId;
		private int rc;
		private DateTime logTime;
		private string logInfo;
		#endregion
		
		#region 构造函数
		public MoExcelSrvStatus()
		{
			  logTime=new DateTime(1900,1,1);   	    
		   
		}
		#endregion
		
		#region 拷贝构造函数

		public MoExcelSrvStatus(MoExcelSrvStatus item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoExcelSrvStatus(string fileId,int rc,DateTime logTime,string logInfo)
		{
		this.fileId=fileId;
		this.rc=rc;
		this.logTime=logTime;
		this.logInfo=logInfo;
		}
		#endregion
		
		#region 表Docsrvstatus的字段属性
		/// <summary>
		/// FILE_ID
		/// </summary>
		public string FileId
		{
			get {return fileId;}
			set {fileId=value;}
		}
		/// <summary>
		///0=没错误,大于1标识有错误。
		/// </summary>
		public int Rc
		{
			get {return rc;}
			set {rc=value;}
		}
		/// <summary>
		/// LOG_TIME
		/// </summary>
		public DateTime LogTime
		{
			get {return logTime;}
			set {logTime=value;}
		}
		/// <summary>
		/// LOG_INFO
		/// </summary>
		public string LogInfo
		{
			get {return logInfo;}
			set {logInfo=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoExcelSrvStatus CopyTo(MoExcelSrvStatus item)
        {
		    item.fileId=this.fileId;
		    item.rc=this.rc;
		    item.logTime=this.logTime;
		    item.logInfo=this.logInfo;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoExcelSrvStatus mo=new MoExcelSrvStatus();
		    mo.FileId=this.FileId;
		    mo.Rc=this.Rc;
		    mo.LogTime=this.LogTime;
		    mo.LogInfo=this.LogInfo;
			return mo;
		}
				///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {		 
            if (object.ReferenceEquals(this,obj))
            {
                return true;
            }
            else
            {
                MoExcelSrvStatus NewDocsrvstatus = obj as MoExcelSrvStatus;
                if (NewDocsrvstatus == null)
                {
                    return false;
                }
                else
                {
				if (NewDocsrvstatus.FileId==this.FileId && NewDocsrvstatus.Rc==this.Rc && NewDocsrvstatus.LogTime==this.LogTime && NewDocsrvstatus.LogInfo==this.LogInfo)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format(System.Globalization.CultureInfo.InvariantCulture,"FileId={0}/Rc={1}/LogTime={2}/LogInfo={3}",fileId,rc,logTime,logInfo);
		 
		}
		#endregion
		
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["File_ID"]!=null && row["File_ID"]!=DBNull.Value)
			{
			    this.FileId = (string)row["File_ID"];
			}
			else
			{
				this.FileId =string.Empty;
			}
		    if(row["RC"]!=null && row["RC"]!=DBNull.Value)
			{
			    this.Rc = (int)row["RC"];
			}
			else
			{
				this.Rc =0;
			}
		    if(row["Log_Time"]!=null && row["Log_Time"]!=DBNull.Value)
			{
			    this.LogTime = (DateTime)row["Log_Time"];
			}
			else
			{
				this.LogTime =DateTime.MinValue;
			}
		    if(row["Log_Info"]!=null && row["Log_Info"]!=DBNull.Value)
			{
			    this.LogInfo = (string)row["Log_Info"];
			}
			else
			{
				this.LogInfo =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["File_ID"] = this.FileId;
			row["RC"] = this.Rc;
			row["Log_Time"] = this.LogTime;
			row["Log_Info"] = this.LogInfo;
		}
		#endregion
	}
}
#endregion
